module.exports = (sql, params = null) => {
    const mysql = require("mysql");
    const conn = mysql.createConnection({
        host: "localhost",
        user: "root",
        password: "root",
        database: "bigevent",
    });
    conn.connect();
    return new Promise((reslove, reject) => {
        conn.query(sql, params, (err, data) => {
            err ? reject(err) : reslove(data);
        });

        conn.end();
    }).catch((err) => {
        console.log(err);
    });
};